package com.example.myzhugezhaofang.presenter;

import com.example.mvplibrary.callback.BaseModelCallback;
import com.example.mvplibrary.presenter.BasePresenter;
import com.example.myzhugezhaofang.callback.Mainconcations;
import com.example.myzhugezhaofang.model.MainModel;

import java.util.HashMap;

/**
 * 作者：朱勇闯
 * data : 2021/4/11  10:03
 * 作用： xxxx
 */
public class MainPresenter<T> extends BasePresenter<Mainconcations.MainView, MainModel> implements BaseModelCallback<T> {
    @Override
    public void onError(String message, int code) {
        getView().showError(message);
    }

    @Override
    public void onSuccess(T t, int type) {
        getView().showList(t, type);
    }

    public void getData(HashMap<String, Object> paramser, String baseUrl, String ApiUrl, int type) {
        getModel().getData(this, getLifecycleProvider(), paramser, baseUrl, ApiUrl, type);
    }
   /* public void onHighOpinionError(String message, int code) {
        getView().showHighOpinionError(message, code);
    }

    public void onLikeError(String message, int code) {
        getView().showLikeError(message, code);
    }

    public void onMarqueeViewError(String message, int code) {
        getView().showMarqueeViewError(message, code);
    }

    public void onNavigationError(String message, int code) {
        getView().showNavigationError(message, code);
    }

    public void onKolimagesError(String message, int code) {
        getView().showKolimagesError(message, code);
    }

    public void onTopicError(String message, int code) {
        getView().showTopicError(message, code);
    }


    @Override
    public <T> void onSuccess(T t) {
        getView().showList(t,);
    }

    public void onHighOpinionSuccess(List<HighOpinionBean.ListBean> listBeans) {
        getView().showHighOpinionList(listBeans);
    }

    public void onLikeSuccess(List<LikeBean.ListBean> listBeans) {
        getView().showLikeList(listBeans);
    }

    public void onNavigationSuccess(List<NavigationBean.ListBean> listBeans) {
        getView().showNavigationList(listBeans);
    }

    public void onMarqueeViewSuccess(List<HeadLinesBean.ListBean> listBeans) {
        getView().showMarqueeViewList(listBeans);
    }

    public void onKolimagesSuccess(List<KolimagesBean.ListnewsBean> listBeans) {
        getView().showKolimagesList(listBeans);
    }

    public void onTopicSuccess(List<TopicBean.ListBean> listBeans) {
        getView().showTopicList(listBeans);
    }

    public void getHighOpinion() {
        getModel().getHighOpinion(this, getLifecycleProvider());
    }

    public void getLike() {
        getModel().getLike(this, getLifecycleProvider());
    }

    public void getNavigation() {
        getModel().getNavigation(this, getLifecycleProvider());
    }

    public void getMarqueeView() {
        getModel().getMarqueeView(this, getLifecycleProvider());
    }

    public void getKolimages() {
        getModel().getkolimages(this, getLifecycleProvider());
    }

    public void getTopic() {
        getModel().getTopic(this, getLifecycleProvider());
    }*/
}
